﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FeedSource.aspx.cs" Inherits="FeedSource"
    MasterPageFile="~/Default.master" EnableViewState="false" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<asp:Content ContentPlaceHolderID="head" ID="hd" runat="server" EnableViewState="false">
    <script src="FeedSource.js" type="text/javascript"></script>

    

    <script src="js/LOV.js" type="text/javascript"></script>

    <link href="FeedSource.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="leftMenu" ID="leftnav" runat="server" EnableViewState="false">
    <% Response.Write(GenerateSideMenu()); %>
    
</asp:Content>
<asp:Content ContentPlaceHolderID="content" ID="ctnFeedSource" runat="server"
    EnableViewState="false">
    <div id="pnlTitle" runat="server"></div>
    <fieldset class="m_fs_border" id="fs_Grid">
        <legend>
            <a class="lnk" href="javascript:toggle('Grid');">
                Feed Source List</a>
        </legend>
        <dl class="m_fs">
            <div id="div_Grid">
                <dxwgv:ASPxGridView ID="dgMain" ClientInstanceName="dgMain_c" runat="server" 
                    AutoGenerateColumns="true" KeyFieldName="ID" 
                    oncustomcallback="dgMain_CustomCallback">
                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" />
                    <SettingsPager PageSize="10"></SettingsPager>
                    <SettingsBehavior AllowSort="true" />
                    <Styles Cell-HorizontalAlign="Left" Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" Header-Wrap="true" Header-Font-Bold="true">
                    <AlternatingRow Enabled="True"></AlternatingRow>
                    <Cell Wrap="True" Font-Size="Smaller"></Cell>
                    </Styles>
                    <Columns>
                        <dxwgv:GridViewDataTextColumn FieldName="NAME" Caption="Nama Source"></dxwgv:GridViewDataTextColumn>                        
                        <dxwgv:GridViewDataTextColumn FieldName="URL" Caption="Link" Width="50px">
                            <DataItemTemplate>
                                <a href="<%# Eval("URL").ToString() %>" style="font-size:8pt;">
                                <%# Eval("URL").ToString() %>
                                </a>
                            </DataItemTemplate>
                            <EditFormSettings Visible="False"/>
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="VALIDITY" Name="Active" Caption="Active" Width="50px" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                            <a href="javascript:ToggleValidity('<%# Eval("ID").ToString() %>');">
                            <img src="images/check<%# GetIcon(Eval("VALIDITY").ToString()) %>.png" alt="toggle status" />
                            </a>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="ID" Name="Edit" Caption="Edit" Width="50px" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                            <a href="javascript:EditFeedSource('<%# Eval("ID").ToString() %>');">Edit</a>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="ID" Name="ID" Caption="Delete" Width="50px" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                            <a href="javascript:DeleteFeedSource('<%# Eval("ID").ToString() %>');">Delete</a>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    </Columns>
                </dxwgv:ASPxGridView>
                <br />
                <div style="display:inline;">
                    <dt><% Response.Write(AdminPageManager.BuildEditor_FeedSourceList()); %></dt>
                    <dd>
                    <input type="button" id="btnAdd" class="btn" onclick="AddFeedSource();" value="Add" style="width:120px;"/>
                    <div id="lnkdscd_Grid"></div>
                    </dd>
                </div>
            </div>
            
        </dl>
    </fieldset>
    <dxcb:ASPxCallback ID="cbkEditor" ClientInstanceName="cbkEditor_c" runat="server"
        OnCallback="cbkEditor_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkEditor_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
</asp:Content>
